package com.onpositive.knowledge.model.value.audits;

import java.util.Set;

import com.onpositive.semantic.model.api.property.IProperty;

public class BasicValuesAudit extends AuditSourceContainer  implements IValueAudit {

	/**
	 * 
	 */
	public final static String ID = "basic-values-audit";
	private static final long serialVersionUID = 1L;

	@Override
	public void perform(IProperty prop, Iterable<Object> objects, AbstractAuditResult auditResult) {
		int count = 0;
		int appliablCount = 0;
		for (Object o : objects) {
			appliablCount++;
			Object value = prop.getValue(o);
			if (value != null) {
				if (value instanceof Object[]) {
					Object[] m = (Object[]) value;
					if (m.length > 0) {
						count++;
					}
				} else {
					count++;
				}
			}
		}
	}

	@Override
	public AbstractAuditResult createAuditResult(IProperty prop) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Set<String> getRequiredAudits() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public String getId() {
		return ID;
	}

}
